const express = require('express')
// 创建路由对象
const router = express.Router()

// 导入用户路由处理函数模块
const authorHandler = require('../../router_handler/author')

// 读取JOSN文件
router.get('/out/getAuthorConfig', authorHandler.getAuthorJSON)

// 获取全部作者信息
router.post('/out/author/getAuthor', authorHandler.getAuthor)

// 获取全部作者信息并根据朝代进行分类
router.get('/out/author/getAuthorOrderByDynasty', authorHandler.getAuthorOrderByDynasty)

// 添加作者信息
router.post('/author/addAuthor', authorHandler.addAuthor)

// 根据朝代或名称查询作者
router.post('/out/author/searchAuthorByDynastyOrName', authorHandler.searchAuthorByDynastyOrName)

// 根据id删除作者信息
router.post('/author/deleteAuthorById', authorHandler.deleteAuthorById)

// 根据id修改作者信息
router.post('/author/updateAuthorById', authorHandler.updateAuthorById)

// 根据id获取作者及作品信息
router.get('/out/author/getAuthorAndPoetryById', authorHandler.getAuthorAndPoetryById)

// 将路由对象共享出去
module.exports = router
